home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / hp48sx.doc < prev    next >
Text File  |  1995-03-31  |  34KB  |  1,151 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.                       H P   4 8 S X   I n t e r n a l s 
  13.  
  14.                                Derek S. Nickel 
  15.  
  16.                                30 January 1991 
  17.      ================================================================ 
  18.         Forward 
  19.     ================================================================ 
  20.  
  21.     This documnent describes some of the internals of the HP 48SX 
  22.     calculator.  Its intended audience is people with a good under- 
  23.     standing of the basic HP 48SX who want to explore the internals 
  24.     of the HP 48SX. 
  25.  
  26.     The information contained here is from a variety of 
  27.     sources:  HP-71B Internal Design Specifications, ROM analysis 
  28.     and other posted information. 
  29.  
  30.     Nothing is perfect.  Double check these notes if you plan to use 
  31.     the information that they contain. 
  32.  
  33.     Send comments and questions to: 
  34.  
  35.         Derek S. Nickel 
  36.         15 Maple Lane 
  37.         Walnut Creek, CA 94595-1718 
  38.      ================================================================ 
  39.         Usage Notes 
  40.     ================================================================ 
  41.  
  42.     In the examples, when ASC\-> is used, the last four characters 
  43.     are the checksum and are not part of the object.  Note that 
  44.     when atomic objects are viewed as a string (via \->ASC or the 
  45.     Memory Scanner) they appear backwards.  This is because the 
  46.     string representation is viewed least-significant-nibble to 
  47.     most-significant nibble in left to right order, whereas binary 
  48.     data is viewed in right to left order. 
  49.  
  50.     Most of the examples list the internal representation as: 
  51.     12345 6789 ABC DEF0 
  52.  
  53.     This corresponds to a memory dump ('48 style) of: 
  54.     xxxxx: 543219876CBA0FED 
  55.  
  56.     or a HEX dump (VAX/VMS style) of: 
  57.                       DE F0 AB C6 78 91 23 45 E#.x....         xxxxx 
  58.      ================================================================ 
  59.         Prologs 
  60.     ================================================================ 
  61.  
  62.     In the HP 48SX, there are many different data types.  Some are 
  63.     common and easy to use: Real Number, Complex Number, Array, 
  64.     String, Binary Integer, List, Directory, Algebraic, Unit, 
  65.     Tagged, Graphic, Backup, Program, Global Name and Local Name. 
  66.     Some are common but hard to create:  Library, Library Data and  
  67.     XLIB Name.  And some, at the user level are nonexistant: 
  68.     System Binary, Long Real, Long Complex, Character, Linked Array 
  69.     and Code. 
  70.  
  71.     One thing that all of these data types have in common is a five 
  72.     nibbles header. This header identifies the data type of the data 
  73.     that follows the header.  This header is called a prolog. 
  74.      ================================================================ 
  75.         Prologs (by prolog address) 
  76.     ================================================================ 
  77.  
  78.     Prolog    Object Name    Type # 
  79.     ------    --------------    ------ 
  80.     02911    System Binary      20 
  81.     02933    Real Number       0 
  82.     02955    Long Real      21 
  83.     02977    Complex Number       1 
  84.     0299D    Long Complex      22 
  85.     029BF    Character      24 
  86.     029E8    Array         3,4 
  87.     02A0A    Linked Array      23 
  88.     02A2C    String           2 
  89.     02A4E    Binary Integer      10 
  90.     02A74    List           5 
  91.     02A96    Directory      15 
  92.     02AB8    Algebraic       9 
  93.     02ADA    Unit          13 
  94.     02AFC    Tagged          12 
  95.     02B1E    Graphic          11 
  96.     02B40    Library          16 
  97.     02B62    Backup          17 
  98.     02B88    Library Data      26 
  99.     02D9D    Program           8 
  100.     02DCC    Code          25 
  101.     02E48    Global Name       6 
  102.     02E6D    Local Name       7 
  103.     02E92    XLIB Name      14 
  104.  
  105.      ================================================================ 
  106.         Prologs (by type number) 
  107.     ================================================================ 
  108.  
  109.     Type #    Prolog    Object Name 
  110.     ------    ------    -------------- 
  111.        0    02933    Real Number 
  112.        1    02977    Complex Number 
  113.        2    02A2C    String 
  114.        3    029E8    Real Array 
  115.        4    029E8    Complex Array 
  116.        5    02A74    List 
  117.        6    02E48    Global Name 
  118.        7    02E6D    Local Name 
  119.        8    02D9D    Program 
  120.        9    02AB8    Algebraic 
  121.       10    02A4E    Binary Integer 
  122.       11    02B1E    Graphic 
  123.       12    02AFC    Tagged 
  124.       13    02ADA    Unit 
  125.       14    02E92    XLIB Name 
  126.       15    02A96    Directory 
  127.       16    02B40    Library 
  128.       17    02B62    Backup 
  129.       18    none    Command 
  130.       19    none    Function 
  131.       20    02911    System Binary 
  132.       21    02955    Long Real 
  133.       22    0299D    Long Complex 
  134.       23    02A0A    Linked Array 
  135.       24    029BF    Character 
  136.       25    02DCC    Code 
  137.       26    02B88    Library Data 
  138.       27    other    Unknown prolog 
  139.  
  140.     Commands and Functions can be expressed as either their address 
  141.     or as XLIB Names.  For example, DUP is normallay represented by 
  142.     the address 1FB87, but it can also be represented by XLIB 2 269 
  143.     (02E9E 002 10D). 
  144.      ================================================================ 
  145.         Internal Object Type Numbers 
  146.     ================================================================ 
  147.  
  148.     The following table lists the internal object types (iTypes) and 
  149.     the objects that they match.  These iTypes are used in the 
  150.     internal RPL operations to do argument type checking.  Note that 
  151.     if the first nibble is an F, then a second nibble follows. 
  152.  
  153.     Also, if a operation requires more that one argument, then each 
  154.     argument will be represented as a digit in the Systen Binary 
  155.     that is used for argument type checking.  For example, the 
  156.     System Binary number <C15h> would mean that stack level one 
  157.     must contain a List, stack level two must contain a Real Number 
  158.     and stack level three must contain a Graphic. 
  159.  
  160.     One nibble iTypes: 
  161.     iType    Objects 
  162.     ------    -------------------------------------------------------- 
  163.     <0h>    Any 
  164.     <1h>    Real Number 
  165.     <2h>    Complex Number 
  166.     <3h>    String 
  167.     <4h>    Array 
  168.     <5h>    List 
  169.     <6h>    Global Name 
  170.     <7h>    Local Name 
  171.     <8h>    Program 
  172.     <9h>    Algebraic 
  173.     <Ah>    Symbolic (Algebraic or Global Name) 
  174.     <Bh>    Binary Integer 
  175.     <Ch>    Graphic 
  176.     <Dh>    Tagged 
  177.     <Eh>    Unit 
  178.  
  179.     Two nibble iTypes (starts with F): 
  180.     iType    Objects 
  181.     ------    -------------------------------------------------------- 
  182.     <Fh>    XLIB Name 
  183.     <1Fh>    System Binary 
  184.     <2Fh>    Directory 
  185.     <3Fh>    Long Real 
  186.     <4Fh>    Long Complex 
  187.     <5Fh>    Linked Array 
  188.     <6Fh>    Character 
  189.     <7Fh>    Code 
  190.     <8Fh>    Library 
  191.     <9Fh>    Backup 
  192.     <AFh>    Library Data 
  193.     <BFh>    ?? prolog <02BAAh> 
  194.     <CFh>    ?? prolog <02BCCh> 
  195.     <DFh>    ?? prolog <02BEEh> 
  196.     <EFh>    ?? prolog <02C10h> 
  197.     <FFh>    ?? <191BEh> 
  198.      ================================================================ 
  199.         Atomic Data Types 
  200.     ================================================================ 
  201.  
  202.     Atomic data types are listed after each field description, in 
  203.     parenthesis.  Note that some atomic data types are more atomic 
  204.     than others. 
  205.  
  206.     **** ASCIC **** 
  207.  
  208.     ASCII counted character strings are represented by length and 
  209.     data fields.  ASCII counted character strings are the basis for 
  210.     Global Name, Local Name and Tagged data types, as well as 
  211.     components in other objects. 
  212.  
  213.       N          2  1     0 
  214.     +-------------+--------+ 
  215.     | String Data | Length | 
  216.     +-------------+--------+ 
  217.             Length        2 
  218.  
  219.     where N = Length/2 + 1. 
  220.  
  221.     **** ASCII **** 
  222.  
  223.     ASCII character strings are represented as a sequence of bytes 
  224.     (ASCII characters).  The length of the ASCII character string is 
  225.     specified elsewhere.  ASCII character strings are called ASCII 
  226.     in the field descriptions.  ASCII character strings are the 
  227.     basis for String data types. 
  228.  
  229.       N          0 
  230.     +-------------+ 
  231.     | String Data | 
  232.     +-------------+ 
  233.             Length 
  234.  
  235.     **** ASCIX **** 
  236.  
  237.     Extended ASCII counted character strings are represented by 
  238.     length and data fields.  If the length is zero, only a single 
  239.     length field is present.  If the length is non-zero, then there 
  240.     are two identical length fields, one before and one after the 
  241.     string data.  Extended ASCII counted character strings are the 
  242.     used in Directory, Library and Backup data types. 
  243.  
  244.       N   N-1 N-2         2  1     0 
  245.     +--------+-------------+--------+ 
  246.     | Length | String Data | Length | 
  247.     +--------+-------------+--------+ 
  248.             2        Length        2 
  249.  
  250.     where N = Length/2 + 2. 
  251.      Atomic Data Types (cont) 
  252.  
  253.     Or, if length is zero: 
  254.  
  255.       1 0 
  256.     +----+ 
  257.     | 00 | 
  258.     +----+ 
  259.       2 
  260.  
  261.     **** BCDx **** 
  262.  
  263.     BCD numbers (binary coded decimal) are represented by a mantissa, 
  264.     sign and exponent fields.  These are two kinds of BCD numbers in 
  265.     the HP48SX, 12-form and 15-form BCD numbers, called BCD12 and 
  266.     BCD15 in the field descriptions. 
  267.  
  268.     Both kinds have several things in common: 
  269.  
  270.         *    A mantissa.  Each digit of the number is represented by 
  271.         one nibble in the mantissa.  12-form BCD numbers have a 
  272.         12 digit mantissa and 15-form BCD numbers have a 15 
  273.         digit mantissa.  There is an implied decimal point after 
  274.         the Most Significant Digit (msd) with respect to the 
  275.         exponent. 
  276.  
  277.         *    A sign nibble.  Positive numbers are represented by a 
  278.         0 and negative numbers are represented by a 9. 
  279.  
  280.         *    An exponent.  The exponent is in 10's compement. 
  281.         12-form BCD numbers have a 3 nibble exponent and 15-form 
  282.         BCD numbers have a 5 digit exponent. 
  283.  
  284.     12-form BCD numbers are the basis for Real Number, Complex 
  285.     Number, Real Array and Complex Array data types. 
  286.  
  287.     15-form BCD numbers are the basis for Long Real and Long 
  288.     Complex data types. 
  289.  
  290.     BCD12: 
  291.  
  292.          15 14                     3  2   0 
  293.     +--+------------------------+------+ 
  294.     |S | msd..  Mantissa  ..lsd | Exp  | 
  295.     +--+------------------------+------+ 
  296.      1             12              3 
  297.  
  298.     BCD15: 
  299.  
  300.      21 20                           5  4       0 
  301.     +--+------------------------------+----------+ 
  302.     |S | msd...    Mantissa    ...lsd |   Exp    | 
  303.     +--+------------------------------+----------+ 
  304.      Atomic Data Types (cont) 
  305.  
  306.     **** BINx **** 
  307.  
  308.     Binary integers are represented by a data field.  Binary integers 
  309.     are called BINx in the field descriptions (where x = the number 
  310.     of nibbles that the number occupies).  Binary integers are the 
  311.     basis for Binary Integers and System Binary data types. 
  312.  
  313.       N          0 
  314.     +-------------+ 
  315.     | Binary Data | 
  316.     +-------------+ 
  317.            x 
  318.  
  319.     where N = x - 1. 
  320.  
  321.     **** CHAR **** 
  322.  
  323.     ASCII characters are represented by a one byte (two nibble) data 
  324.     field.  ASCII characters are called CHAR in the field 
  325.     descriptions.  ASCII characters are the basis for the Character 
  326.     data type. 
  327.  
  328.       1        0 
  329.     +-----------+ 
  330.     | Character | 
  331.     +-----------+ 
  332.           2 
  333.  
  334.     **** CODE **** 
  335.  
  336.     Machine code is represented as a sequence of nibbles that is the 
  337.     machine code.  Machine code is called CODE in the field 
  338.     descriptions.  Machine code is the basis for the Code data type. 
  339.  
  340.     Examples in this document use the HP mneumonics. 
  341.      ================================================================ 
  342.         System Binary (02911) 
  343.     ================================================================ 
  344.  
  345.     <prolog><data> 
  346.  
  347.     <prolog> = 02911 (BIN5) 
  348.  
  349.     <data> = five nibble binary integer (BIN5) 
  350.  
  351.     There are several tables of System Binary numbers: 
  352.  
  353.      addr      HEX    description 
  354.     ------    -------  ------------------------------------------------ 
  355.     03F8B    <2933h>  Real Number prolog 
  356.     03F95    <2977h>  Complex Number prolog 
  357.     03F9F    <2A74h>  List prolog 
  358.     03FA9    <2911h>  Global Name prolog 
  359.     03FB3    <2D9Dh>  Program prolog 
  360.     03FBD    <2AB8h>  Algebraic prolog 
  361.     03FC7    <2A96h>  Directory prolog 
  362.     03FD1    <2E6Dh>  Local Name prolog 
  363.     03FDB    <2955h>  Long Real prolog 
  364.     03FE5    <2ADAh>  Unit prolog 
  365.  
  366.      addr     HEX     DEC 
  367.     ------    ------    ------ 
  368.     03FEF    <0h>    <0d> 
  369.     03FF9    <1h>    <1d> 
  370.     04003    <2h>    <2d> 
  371.     0400D    <3h>    <3d> 
  372.     04017    <4h>    <4d> 
  373.     04021    <5h>    <5d> 
  374.     0402B    <6h>    <6d> 
  375.     04035    <7h>    <7d> 
  376.     0403F    <8h>    <8d> 
  377.     04049    <9h>    <9d> 
  378.     04053    <Ah>    <10d> 
  379.     0405D    <Bh>    <11d> 
  380.     04067    <Ch>    <12d> 
  381.     04071    <Dh>    <13d> 
  382.     04073    <Eh>    <14d> 
  383.     04085    <Fh>    <15d> 
  384.     0408F    <10h>    <16d> 
  385.     04099    <11h>    <17d> 
  386.     040A3    <12h>    <18d> 
  387.     040AD    <13h>    <19d> 
  388.     040B7    <14h>    <20d> 
  389.     040C1    <15h>    <21d> 
  390.     040CB    <16h>    <22d> 
  391.     040D5    <17h>    <23d> 
  392.     040DF    <18h>    <24d> 
  393.     040E9    <19h>    <25d> 
  394.     040F3    <1Ah>    <26d> 
  395.     040FD    <1Bh>    <27d> 
  396.     04107    <1Ch>    <28d> 
  397.     04111    <1Dh>    <29d> 
  398.     0411B    <1Eh>    <30d> 
  399.     04125    <1Fh>    <31d> 
  400.      System Binary (cont) 
  401.  
  402.     0412F    <20h>    <32d> 
  403.     04139    <21h>    <33d> 
  404.     04143    <22h>    <34d> 
  405.     0414D    <23h>    <35d> 
  406.     04157    <24h>    <36d> 
  407.     04161    <25h>    <37d> 
  408.     0416B    <26h>    <38d> 
  409.     04175    <27h>    <39d> 
  410.     0417F    <28h>    <40d> 
  411.     04189    <29h>    <41d> 
  412.     04193    <2Ah>    <42d> 
  413.     0419D    <2Bh>    <43d> 
  414.  
  415.     There are several routines to convert between System Binary and 
  416.     other data types.  No error checking is performed by these 
  417.     routines. 
  418.  
  419.      addr     name    description 
  420.     ------    ------    ------------------------------------------------ 
  421.     18CEA    R\->SB    Real Number to System Binary 
  422.     18DBF    SB\->R    System Binary to Real Number 
  423.  
  424.     Example: 
  425.  
  426.     Create a System Binary with a decimal value of 48. 
  427.  
  428.     02911 00030 
  429.  
  430.     "1192003000C53E" ASC\-> returns <30h> 
  431.  
  432.      - or - 
  433.  
  434.     48 #18CEAh SYSEVAL returns <30h> 
  435.      ================================================================ 
  436.         Real Number (02933) 
  437.     ================================================================ 
  438.  
  439.     <prolog><data> 
  440.  
  441.     <prolog> = 02933 (BIN5) 
  442.  
  443.     <data> = 12-form BCD number (BCD12) 
  444.  
  445.     There are several tables of Real Number and Long Real numbers: 
  446.  
  447.      addr     value 
  448.     ------    ---------------- 
  449.     2A2B4    0 
  450.     2A2C9    1 
  451.     2A2DF    2 
  452.     2A2F3    3 
  453.     2A308    4 
  454.     2A3D1    5 
  455.     2A332    6 
  456.     2A347    7 
  457.     2A35C    8 
  458.     2A371    9 
  459.     2A386    -1 
  460.     2A39B    -2 
  461.     2A3B0    -3 
  462.     2A3C5    -4 
  463.     2A3DA    -5 
  464.     2A3EF    -6 
  465.     2A404    -7 
  466.     2A419    -8 
  467.     2A42E    -9 
  468.     2A443    3.14159265359 
  469.     2A458    3.14159265358979 (Long Real) 
  470.     2A472    9.99999999999E499 
  471.     2A487    -9.99999999999E499 
  472.     2A49C    1.E-499 
  473.     2A4B1    -1.E-499 
  474.     2A4C6    0 (Long Real) 
  475.     2A4E0    1 (Long Real) 
  476.     2A4FA    2 (Long Real) 
  477.     2A514    3 (Long Real) 
  478.     2A52E    4 (Long Real) 
  479.     2A548    5 (Long Real) 
  480.     2A562    .1 (Long Real) 
  481.     2A57C    .5 (Long Real) 
  482.     2A596    10 (Long Real) 
  483.  
  484.     There are several routines to convert between Real Number and 
  485.     other data types.  No error checking is performed by these 
  486.     routines. 
  487.  
  488.      addr     name    description 
  489.     ------    ------    ------------------------------------------------ 
  490.     2A5B0    LR->R    Long Real to Real Number 
  491.     2A5C1    R->LR    Real Number to Long Real 
  492.      Real Number (cont) 
  493.  
  494.     Example: 
  495.  
  496.     Create a Real Number with the value of the golden mean: 
  497.  
  498.     02933 0161863398875000 
  499.  
  500.     "3392000057889330816106AB0" ASC\-> returns 
  501.         1.61863398875 
  502.  
  503.      ================================================================ 
  504.         Long Real (02955) 
  505.     ================================================================ 
  506.  
  507.     <prolog><data> 
  508.  
  509.     <prolog> = 02955 (BIN5) 
  510.  
  511.     <data> = 15-form BCD number (BCD15) 
  512.      ================================================================ 
  513.         Complex Number (02977) 
  514.     ================================================================ 
  515.  
  516.     <prolog><real-part><imaginary-part> 
  517.  
  518.     <prolog> = 02977 (BIN5) 
  519.  
  520.     <real-part> = 12-form BCD number (BCD12) 
  521.  
  522.     <imaginary-part> = 12-form BCD number (BCD12) 
  523.      ================================================================ 
  524.         Long Complex (0299D) 
  525.     ================================================================ 
  526.  
  527.     <prolog><real-part><imaginary-part> 
  528.  
  529.     <prolog> = 0299D (BIN5) 
  530.  
  531.     <real-part> = 15-form BCD number (BCD15) 
  532.  
  533.     <imaginary-part> = 15-form BCD number (BCD15) 
  534.      ================================================================ 
  535.         Character (029BF) 
  536.     ================================================================ 
  537.  
  538.     <prolog><data> 
  539.  
  540.     <prolog> = 029BF (BIN5) 
  541.  
  542.     <data> = ASCII coded character (CHAR) 
  543.      ================================================================ 
  544.         Array (029E8) 
  545.     ================================================================ 
  546.  
  547.     <prolog><size><item-prolog><#dims><dim-1>...<dim-n><item-1>... 
  548.         <item-m> 
  549.  
  550.     <prolog> = 029EB (BIN5) 
  551.  
  552.     <size> = number of nibbles remaining (BIN5) 
  553.  
  554.     <item-prolog> = prolog for array elements (BIB5) 
  555.  
  556.     <#dims> = number of array dimensions (BIN5) 
  557.  
  558.     <dim-i> = i-th dimension (BIN5) 
  559.  
  560.     <item-j> = j-th item (ANY) 
  561.  
  562.     n = <#dims> 
  563.     m = <dim-1> * <dim-2> * ... * <dim-n> 
  564.  
  565.     The items in the array are stored in Row Major order (all of the 
  566.     first rows elements are group together, followed by the second 
  567.     row, and so forth.) 
  568.  
  569.     In normal calculator operations: 
  570.  
  571.         *    Only one and two dimensional arrays are supported. 
  572.  
  573.         *    Only Real Numbers and Complex Numbers are supported as 
  574.         array elements (items). 
  575.  
  576.     Some assumtions are made about various fields with normal 
  577.     operations: 
  578.  
  579.         *    If <item-prolog> is not Real Number, then its assumed to 
  580.         be Complex Number. 
  581.  
  582.         *    If #Dims is not 1, its assumed to be 2. 
  583.  
  584.     This applies to the Matrix Editor, GET and so forth. 
  585.  
  586.     But the '48 uses other types of arrays internally.  For example, 
  587.     message tables are "Array of String". 
  588.      ================================================================ 
  589.         Linked Array (02A0A) 
  590.     ================================================================ 
  591.  
  592.     <prolog><size><???> 
  593.  
  594.     <prolog> = 02A0A (BIN5) 
  595.  
  596.     <size> = number of nibbles remaining (BIN5) 
  597.  
  598.     <???> = undetermined... 
  599.      ================================================================ 
  600.         String (02A2C) 
  601.     ================================================================ 
  602.  
  603.     <prolog><size><data> 
  604.  
  605.     <prolog> = 02A2C (BIN5) 
  606.  
  607.     <size> = number of nibbles remaining (BIN5) 
  608.  
  609.     <data> = (<size>-5)/2 byte character string (ASCII) 
  610.      ================================================================ 
  611.         Binary Integer (02A4E) 
  612.     ================================================================ 
  613.  
  614.     <prolog><size><data> 
  615.  
  616.     <prolog> = 02A4E (BIN5) 
  617.  
  618.     <size> = number of nibbles remaining (BIN5) 
  619.  
  620.     <data> = binary integer (BINx, where x = <size> - 5) 
  621.  
  622.     Most Binary Integers have a data size of 16 nibbles or 64 bits 
  623.     (<size> = 21).  But some have a smaller data size.  For example, 
  624.     the BYTES command returns a Binary Integer (the checksum) with a 
  625.     data size of 4 nibbles or 16 bits (<size> = 9), whereas the Hash 
  626.     Table in a Library looks like a very large Binary Integer. 
  627.      ================================================================ 
  628.         List (02A74) 
  629.     ================================================================ 
  630.  
  631.     <prolog><object-1>...<object-n><end-marker> 
  632.  
  633.     <prolog> = 02A74 (BIN5) 
  634.  
  635.     <object-i> = i-th object (ANY) 
  636.  
  637.     <end-marker> = 0312B (BIN5) 
  638.      ================================================================ 
  639.         Directory (02A96) 
  640.     ================================================================ 
  641.  
  642.     <prolog><attachments><offset-1><end-dir> 
  643.         <name-n><object-n><offset-n>... 
  644.         <name-2><object-2><offset-2> 
  645.         <name-1><object-1> 
  646.  
  647.     <prolog> = 02A96 (BIN5) 
  648.  
  649.     <attachments> = see comments (BIN3) 
  650.  
  651.     <end-dir> = 00000; end of directory marker (backwards scanned). 
  652.         This is in the position that the <offset-n+1> field would 
  653.         have occuppied (BIN5) 
  654.  
  655.     <offset-i> = offset (backward pointing) from the beginning of 
  656.         the i'th offset field to the beginning of the i'th object's 
  657.         name.  (BIN5) 
  658.  
  659.     <name-i> = the name of the i-th object (ASCIX) 
  660.  
  661.     <object-i> = the i'th object in the directory (ANY) 
  662.  
  663.     Comments: 
  664.  
  665.     The meaning of the <attachments> field is based on whether or 
  666.     not the directory is the HOME directory. 
  667.  
  668.     HOME directory:  the <attachments> field contains the number of 
  669.     libraries attached to the HOME directory, including the default, 
  670.     'hidden' libraries: Library 2, standard functions; Library 1792, 
  671.     flow control statments. 
  672.  
  673.     Subdirectory:  the <attachments> field contains the library 
  674.     number of the library attached to this subdirectory or 7FF if 
  675.     no library is attached. 
  676.      ================================================================ 
  677.         Algebraic (02AB8) 
  678.     ================================================================ 
  679.  
  680.     <prolog> ... <end-marker> 
  681.  
  682.     <prolog> = 02AB8 (BIN5) 
  683.  
  684.     The "..." part is a sequence of objects and operations. 
  685.  
  686.     <end-marker> = 0312B (BIN5) 
  687.  
  688.     Example: 
  689.  
  690.     Create the expression 'A-2'. 
  691.  
  692.     02AB8        Algebraic 
  693.     02E48 01 41    'A' (Global Name) 
  694.     2A2DE        2 (address in ROM) 
  695.     1AD09        - 
  696.     0312B        End Marker 
  697.  
  698.     "8BA2084E201014ED2A209DA1B21303637" \-> returns 
  699.         'A-2' 
  700.      ================================================================ 
  701.         Unit (02ADA) 
  702.     ================================================================ 
  703.  
  704.     <prolog><numeric-data><unit-1>...<unit-n><operation-1>... 
  705.         <operation-n><end-marker> 
  706.  
  707.     <prolog> = 02ADA (BIN5) 
  708.  
  709.     <numeric-data> = the base data, if not Real Number, then will 
  710.         be displayed as UNKNOWN (ANY) 
  711.  
  712.     <unit-i> = unit component (normally String or Real Number) (ANY) 
  713.  
  714.     <operation-j> = unit arithmetic indicator.  These indicators 
  715.         point to null lists { }, but are interpreted by the OS as 
  716.         simple unit operations (* / and so forth) (BIN5) 
  717.  
  718.         10B5E * (unit operator) 
  719.         10B68 / (unit operator) 
  720.         10B72 ^ (unit operator) 
  721.         10B7C Character prefix (unit operator) 
  722.         10B86 _ (unit operator) 
  723.  
  724.     <end-marker> = 0312B (BIN5) 
  725.      ================================================================ 
  726.         Tagged (02AFC) 
  727.     ================================================================ 
  728.  
  729.     <prolog><name><object> 
  730.  
  731.     <prolog> = 02AFC (BIN5) 
  732.  
  733.     <name> = the tag (ASCIC) 
  734.  
  735.     <object> = the tagged object (ANY) 
  736.  
  737.     Example: 
  738.     Create a the Real Number 1.23456789012 with a tag of "ABC" 
  739.  
  740.     02AFC 03 41 42 43 02933 0123456789012000 
  741.  
  742.     "CFA20301424343392000021098765432107141" ASC\-> returns 
  743.         ABC: 1.23456789012 
  744.      ================================================================ 
  745.         Graphic (02B1E) 
  746.     ================================================================ 
  747.  
  748.     <prolog><size><#rows><#columns><data> 
  749.  
  750.     <prolog> = 02B1E (BIN5) 
  751.  
  752.     <size> = number of nibbles remaining (BIN5) 
  753.  
  754.     <#rows> = number of pixel rows (BIN5) 
  755.  
  756.     <#columns> = number of pixel columns (BIN5) 
  757.  
  758.     <data> = graphic data, <size>-15 nibbles (BINx) 
  759.  
  760.     Each pixel in the Graphic is represented by a bit in <data>. 
  761.     The pixels are grouped first by row and then by column. 
  762.  
  763.     The pixels for each row run for left to right and the bits for 
  764.     those pixels run from least significant bit to most significant 
  765.     bit.  Note that each row of pixels is padded to an even number 
  766.     of nibbles.  For example:  a normal 131 X 64 Graphic requires 
  767.     34 nibbles (136 bits) per row for a total of 2176 nibbles (not 
  768.     counting the overhead of 20 nibbles). 
  769.  
  770.     X = <#columns> - 1 
  771.     Y = <#rows> - 1 
  772.  
  773.        0                       X 
  774.       +-------------------------+ 
  775.     0 |                         | 
  776.       |                         | 
  777.       |         Display         | 
  778.       |                         | 
  779.     Y |                         | 
  780.       +-------------------------+ 
  781.  
  782.     M = <#rows> - 1 
  783.     N = 2*CEIL(<#columns>/8) - 1 
  784.     N' = unpadded row size 
  785.     ??? = padding 
  786.  
  787.       N  N'                     0 
  788.     +---+-->>--------------------+ 
  789.     |???|                        |  Row 0 
  790.     +---+--<<--------------------+ 
  791.     |???|                        |  Row 1 
  792.     +---+-->>--------------------+ 
  793.         :            : 
  794.     +---+-->>--------------------+ 
  795.     |???|                        |  Row M 
  796.     +---+--<<--------------------+ 
  797.      ================================================================ 
  798.         Library (02B40) 
  799.     ================================================================ 
  800.  
  801.     <prolog><size><library-name><library-number><hash-table-offset> 
  802.         <message-table-offset><link-table-offset><config-offset> 
  803.         <bulk-of-library><checksum> 
  804.  
  805.     <prolog> = 02B40 (BIN5) 
  806.  
  807.     <size> = number of nibbles remaining (BIN5) 
  808.  
  809.     <library-name> = Extended ASCII counted character string (ASCIX) 
  810.  
  811.     <library-number> = library number (BIN3) 
  812.  
  813.     <hash-table-offset> = offset to hash table (BIN5) 
  814.  
  815.     <message-table-offset> = offset to message table (BIN5) 
  816.  
  817.     <link-table-offset> = offset to link table (BIN5) 
  818.  
  819.     <config-offset> = offset to configuration code (BIN5) 
  820.  
  821.     <bulk-of-library> : <hash-table>, <message-table>, <link-table>, 
  822.         <config-code> and the rest (in any order) 
  823.  
  824.     <checksum> = internal library checksum (BIN4) 
  825.  
  826.     <hash-table> : <ht-prolog><ht-size><offset-1>...<offset-16> 
  827.         <nt-size><nt-entry-1>...<nt-entry-n><nt-offset-1>... 
  828.         <nt-offset-n> 
  829.  
  830.     <ht-prolog> = 02A4E (Binary Integer) (BIN5) 
  831.  
  832.     <ht-size> = size of hash table without the prolog (BIN5) 
  833.  
  834.     <offset-i> = offset into the name table for the first command 
  835.         with an i-character name (BIN5) 
  836.  
  837.     <nt-size> = size in nibbles of the name table (BIN5) 
  838.  
  839.     <nt-entry-j> : <command-name><xlib-number> 
  840.  
  841.     <command-name> = ASCII counted character string (ASCIC) 
  842.  
  843.     <xlib-number> = XLIB command number (BIN3) 
  844.  
  845.     <nt-offset-k> = offset to <nt-entry-j> for XLIB command k (BIN5) 
  846.         This offset is backward pointing. 
  847.  
  848.     <message-table> = Array of String.  Each array element is a 
  849.         message. 
  850.  
  851.     <link-table> : <lt-prolog><lt-size><lt-entry-1>...<lt-entry-n> 
  852.  
  853.     <lt-prolog> = 02A4E (BIN5) 
  854.  
  855.     <lt-size> = size of link table without the prolog (BIN5) 
  856.      Library (cont) 
  857.  
  858.     <lt-entry-i> = offset to i-th command in this library (BIN5) 
  859.  
  860.     <config-code> = RPL subprogram that performs configuration 
  861.         commands 
  862.  
  863.     Comments: 
  864.  
  865.     The hash table and link table are very large Binary Integers. 
  866.     The message table is an Array of String. 
  867.  
  868.     Example: 
  869.  
  870.     Unthread part of the stop watch library.  See the Voayager 
  871.     Reference Manual for details on Voyager commands. 
  872.  
  873.     Voyager> load 1 sw-a 
  874.     Voyager> ut 80000 
  875.     80000: ; *** Library 768: SW-A *** 
  876.     80000: 02B40 ! Library 
  877.     80005: 01608 ! 5640 nibbles (next RPL at 8160D) 
  878.     8000A: [...] ! Library name: "SW-A" 
  879.     80016: 300   ! Library number 768 
  880.     80019: 00014 ! Hash table at 8002D 
  881.     8001E: 001F2 ! Message table at 80210 
  882.     80023: 00107 ! Link table at 8012A 
  883.     80028: 01543 ! Configuration code at 8156B 
  884.     Voyager> exam hash 8002D 300 
  885.     8002D: ; *** Hash table for library 300 (XLIB 768) *** 
  886.     8002D: 02A4E ! (Binary Integer) 
  887.     80032: 000F8 ! 248 nibbles (next at 8012A) 
  888.     80037: 00000 !    1 none 
  889.     8003C: 00000 !    2 none 
  890.     80041: 00000 !    3 none 
  891.     80046: 00046 !    4 at 8008C 
  892.     8004B: 00000 !    5 none 
  893.     80050: 00000 !    6 none 
  894.     80055: 00085 !    7 at 800DA 
  895.     8005A: 00093 !    8 at 800ED 
  896.     8005F: 00000 !    9 none 
  897.     80064: 00000 !   10 none 
  898.     80069: 00000 !   11 none 
  899.     8006E: 00000 !   12 none 
  900.     80073: 00000 !   13 none 
  901.     80078: 00000 !   14 none 
  902.     8007D: 00000 !   15 none 
  903.     80082: 00000 !   16 none 
  904.     80087: 0007B ! 123 nibbles (next at 80102) 
  905.     8008C: [...] !   DOSW (XLIB 768 0) 
  906.     80099: [...] !   PALL (XLIB 768 5) 
  907.     800A6: [...] !   PSP+ (XLIB 768 4) 
  908.     800B3: [...] !   VALL (XLIB 768 3) 
  909.     800C0: [...] !   VSP+ (XLIB 768 1) 
  910.     800CD: [...] !   VSP- (XLIB 768 2) 
  911.     800DA: [...] !   RESETSW (XLIB 768 7) 
  912.     800ED: [...] !   RCLSPLIT (XLIB 768 6) 
  913.     80102: 00076 !   name for XLIB 768 0 at 8008C 
  914.      Library (cont) 
  915.  
  916.     80107: 00047 !   name for XLIB 768 1 at 800C0 
  917.     8010C: 0003F !   name for XLIB 768 2 at 800CD 
  918.     80111: 0005E !   name for XLIB 768 3 at 800B3 
  919.     80116: 00070 !   name for XLIB 768 4 at 800A6 
  920.     8011B: 00082 !   name for XLIB 768 5 at 80099 
  921.     80120: 00033 !   name for XLIB 768 6 at 800ED 
  922.     80125: 0004B !   name for XLIB 768 7 at 800DA 
  923.     Voyager> exam link 8012A 300 
  924.     8012A: ; *** Link table for library 300 (XLIB 768) *** 
  925.     8012A: 02A4E ! (Binary Integer) 
  926.     8012F: 000E1 ! 225 nibbles (next at 80210) 
  927.     80134: 00167 !   XLIB 768 0 at 8029B 
  928.     80139: 00183 !   XLIB 768 1 at 802BC 
  929.     8013E: 001A4 !   XLIB 768 2 at 802E2 
  930.     80143: 001C5 !   XLIB 768 3 at 80308 
  931.     80148: 001E1 !   XLIB 768 4 at 80329 
  932.     8014D: 00202 !   XLIB 768 5 at 8034F 
  933.     80152: 0021E !   XLIB 768 6 at 80370 
  934.     80157: 0023F !   XLIB 768 7 at 80396 
  935.     8015C: 00254 !   XLIB 768 8 at 803B0 
  936.     80161: 002DE !   XLIB 768 9 at 8043F 
  937.     80166: 00303 !   XLIB 768 10 at 80469 
  938.     8016B: 00328 !   XLIB 768 11 at 80493 
  939.     80170: 0037D !   XLIB 768 12 at 804ED 
  940.     80175: 0044F !   XLIB 768 13 at 805C4 
  941.     8017A: 004E7 !   XLIB 768 14 at 80661 
  942.     8017F: 00500 !   XLIB 768 15 at 8067F 
  943.     80184: 00514 !   XLIB 768 16 at 80698 
  944.     80189: 005BC !   XLIB 768 17 at 80745 
  945.     8018E: 005E1 !   XLIB 768 18 at 8076F 
  946.     80193: 00605 !   XLIB 768 19 at 80798 
  947.     80198: 0069D !   XLIB 768 20 at 80835 
  948.     8019D: 006CD !   XLIB 768 21 at 8086A 
  949.     801A2: 0072A !   XLIB 768 22 at 808CC 
  950.     801A7: 00753 !   XLIB 768 23 at 808FA 
  951.     801AC: 00792 !   XLIB 768 24 at 8093E 
  952.     801B1: 00819 !   XLIB 768 25 at 809CA 
  953.     801B6: 00832 !   XLIB 768 26 at 809E8 
  954.     801BB: 008B1 !   XLIB 768 27 at 80A6C 
  955.     801C0: 008DA !   XLIB 768 28 at 80A9A 
  956.     801C5: 00E8C !   XLIB 768 29 at 81051 
  957.     801CA: 00F55 !   XLIB 768 30 at 8111F 
  958.     801CF: 00F95 !   XLIB 768 31 at 81164 
  959.     801D4: 00FBC !   XLIB 768 32 at 81190 
  960.     801D9: 00FE7 !   XLIB 768 33 at 811C0 
  961.     801DE: 010AC !   XLIB 768 34 at 8128A 
  962.     801E3: 0111D !   XLIB 768 35 at 81300 
  963.     801E8: 0113A !   XLIB 768 36 at 81322 
  964.     801ED: 01155 !   XLIB 768 37 at 81342 
  965.     801F2: 0116A !   XLIB 768 38 at 8135C 
  966.     801F7: 011EE !   XLIB 768 39 at 813E5 
  967.     801FC: 0136F !   XLIB 768 40 at 8156B 
  968.     80201: 01383 !   XLIB 768 41 at 81584 
  969.     80206: 01396 !   XLIB 768 42 at 8159C 
  970.     8020B: 013A9 !   XLIB 768 43 at 815B4 
  971.      Library (cont) 
  972.  
  973.     Voyager> exam message 80210 300 
  974.     80210: ; *** Message table for library 300 (XLIB 768) *** 
  975.     80210: 029E8 ! Array 
  976.     80215: 0007F ! 127 nibbles 
  977.     8021A: 02A2C ! ...of String 
  978.     8021F: 00001 ! 1 dimensional 
  979.     80224: 00003 ! Dim-1 = 3 
  980.      . . . . . . ! 3 total elements 
  981.     80229: [...] ! "Invalid SWDAT" 
  982.     80248: [...] ! "Invalid Split#" 
  983.     80269: [...] ! "Invalid Environment" 
  984.     Voyager> ut 8156B 
  985.     8156B: ; *** Configuaration code for library 300 (XLIB 768 40) *** 
  986.     8156B: 02D9D ! Program 
  987.     81570: [...] ! <300h> 
  988.     8157A: 07709 ; Internal ATTACH to HOME directory (1:System Binary) 
  989.     8157F: 0312B ! End Marker 
  990.     Voyager> ut 8029B 
  991.     8029B: ; *** DOSW (XLIB 768 0) *** 
  992.     8029B: 02D9D ! Program 
  993.     802A0: 18A1E ; save last RPL token, stack size, clear @706FD.S 
  994.     802A5: [...] ! XLIB 768 8 
  995.     802B0: 0312B ! End Marker 
  996.     Voyager> exit 
  997.      ================================================================ 
  998.         Backup (02B62) 
  999.     ================================================================ 
  1000.  
  1001.     <prolog><size><name><data><???> 
  1002.  
  1003.     <prolog> = 02B62 (BIN5) 
  1004.  
  1005.     <size> = number of nibbles remaining (BIN5) 
  1006.  
  1007.     <name> = the name of the backup (ASCIX) 
  1008.  
  1009.     <data> = the backed-up data (ANY) 
  1010.  
  1011.     <???> = a System Binary, possably a checksum. 
  1012.      ================================================================ 
  1013.         Library Data (02B88) 
  1014.     ================================================================ 
  1015.  
  1016.     <prolog><size><ident><data-1>...<data-n><end-marker> 
  1017.  
  1018.     <prolog> = 02B88 (BIN5) 
  1019.  
  1020.     <size> = number of nibbles remaining (BIN5) 
  1021.  
  1022.     <ident> = <library-number><object-number> (BIN5) 
  1023.  
  1024.     <library-number> = library number (BIN3) 
  1025.  
  1026.     <object-number> = object number (library specific) (BIN2) 
  1027.  
  1028.     <data-i> = the 'hidden' library data (ANY) 
  1029.  
  1030.     <end-marker> = 0312B (BIN5) 
  1031.  
  1032.     Example: 
  1033.  
  1034.     What's in 'MHpar' (MINEHUNT parameter) (EQ Library required)? 
  1035.  
  1036.     MINEHUNT STO MHpar \->ASC returns: 
  1037.  
  1038.     "88B205C900C010047A20E1B20... 
  1039.     ...B21300040" 
  1040.  
  1041.     which translates to Library Data 268/0, contents: 
  1042.  
  1043.     { Graphic 131 x 64 
  1044.     <1h> <1h> <1h> 
  1045.     "20000001000100000... 
  1046.     } 
  1047.      ================================================================ 
  1048.         Program (02D9D) 
  1049.     ================================================================ 
  1050.  
  1051.     <prolog> ... <end-marker> 
  1052.  
  1053.     <prolog> = 02D9D (BIN5) 
  1054.  
  1055.     The "..." part is a sequence of objects. 
  1056.  
  1057.     <end-marker> = 0312B (BIN5) 
  1058.  
  1059.     Examples: 
  1060.  
  1061.     1) Write a strictly user-mode program to drop the stack level 
  1062.     two object.  This operation is called NIP by some people. 
  1063.  
  1064.     02D9D    Program 
  1065.     2361E    \<< 
  1066.     1FBBD      SWAP 
  1067.     1FBD8      DROP 
  1068.     23639    \>> 
  1069.     0312B    End Marker 
  1070.  
  1071.     "D9D29E1632DBBE18DDF193632B21306A65" ASC\-> returns 
  1072.         \<< SWAP DROP \>> 
  1073.  
  1074.     2) Write the same program using internal routines, with error 
  1075.     checking (standalone version, non-library). 
  1076.  
  1077.     02D9D    Program 
  1078.     18A8D    Verify DEPTH >= 2 
  1079.     60F9B    drop level two object 
  1080.     0312B    End Marker 
  1081.  
  1082.     "D9D20D8A81B9F06B2130D01D" ASC\-> returns 
  1083.         External External 
  1084.      ================================================================ 
  1085.         Code (02DCC) 
  1086.     ================================================================ 
  1087.  
  1088.     <prolog><size><machine-code> 
  1089.  
  1090.     <prolog> = 02DCC (BIN5) 
  1091.  
  1092.     <size> = number of nibbles remaining (BIN5) 
  1093.  
  1094.     <machine-code> = machine code (<size>-5 nibbles) (CODE) 
  1095.      ================================================================ 
  1096.         Global Name (02E48) 
  1097.     ================================================================ 
  1098.  
  1099.     <prolog><name> 
  1100.  
  1101.     <prolog> = 02E48 (BIN5) 
  1102.  
  1103.     <name> = ASCII counted character string (ASCIC) 
  1104.  
  1105.     Example: 
  1106.     Create a Global Name called 'GBL'. 
  1107.  
  1108.     02E48 03 47 42 4C 
  1109.  
  1110.     "84E20307424C4A205" ASC\-> returns 'GBL' 
  1111.      ================================================================ 
  1112.         Local Name (02E6D) 
  1113.     ================================================================ 
  1114.  
  1115.     <prolog><name> 
  1116.  
  1117.     <prolog> = 02E6D (BIN5) 
  1118.  
  1119.     <name> = ASCII counted character string (ASCIC) 
  1120.  
  1121.     Example: 
  1122.     Create a Local Name called 'LCL'. 
  1123.  
  1124.     02E6D 03 4C 43 4C 
  1125.  
  1126.     "D6E2030C434C4DCA1" ASC\-> returns 'LCL' 
  1127.     Executing EVAL at this point will generate an 'EVAL Error: 
  1128.     Undefined Local Name'. 
  1129.      ================================================================ 
  1130.         XLIB Name (02E92) 
  1131.     ================================================================ 
  1132.  
  1133.     <prolog><library-number><object-number> 
  1134.  
  1135.     <prolog> = 02E92 (BIN5) 
  1136.  
  1137.     <library-number> = library number (BIN3) 
  1138.  
  1139.     <object-number> = object number with library (BIN3) 
  1140.  
  1141.     Example: 
  1142.     The XLIB name for the EQ Library's MINEHUNT is XLIB 268 0 
  1143.  
  1144.     02E92 10C 000 
  1145.  
  1146.     If you have the EQ Library: 
  1147.     "29E20C01000FEA7" ASC\-> returns MINEHUNT 
  1148.  
  1149.     If you don't: 
  1150.     "29E20C01000FEA7" ASC\-> returns XLIB 268 0 
  1151.